<template>
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
        <el-form-item label="运单id" prop="transportOrderId">
            <el-input
                    v-model="queryParams.transportOrderId"
                    ref="queryParams.transportOrderId"
                    placeholder="请输入运单id"
                    clearable
                    size="small"
                    wrapper="eq"
                    @keyup.enter.native="handleQuery"
            />
        </el-form-item>
        <el-form-item label-width="200" label="异常类型id。取自字典表" prop="abnormalTypeId">
            <el-input
                    v-model="queryParams.abnormalTypeId"
                    ref="queryParams.abnormalTypeId"
                    placeholder="请输入异常类型id。取自字典表"
                    clearable
                    size="small"
                    wrapper="eq"
                    @keyup.enter.native="handleQuery"
            />
        </el-form-item>
        <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
    </el-form>
</template>

<script>
    import {Condition} from "../utils/seacrhParams";

    export default {
        name: "SearchForm",
        data(){
            return {
                showSearch: true,
                // 查询数据对象
                queryParams: {
                    pageNum: 1,
                    pageSize: 10,
                    transportOrderId: null,
                    abnormalTypeId: null,
                    abnormalTypeName: null,
                    pics: null,
                    operator: null,
                    lastUpdateOperator: null
                },
                //搜索参数字段类型配置，配置对象的key必须和搜索字段同名
                // 未做配置定义的字段将会原样输出到后端，通常分页参数不需要配置
                // Condition 对象封装了快捷函数直接生成匹配规则，需要import后使用
                queryParamsConfig: {
                    transportOrderId: Condition.like(),
                    abnormalTypeId: Condition.like(),
                    abnormalTypeName: Condition.eq(),
                    pics: Condition.contains(),
                    operator: Condition.eq(),
                    lastUpdateOperator: Condition.eq()
                }
            }

        },

        methods:{
            /** 搜索按钮操作 */
            handleQuery() {
                // 使用全局的搜索参数处理方法预处理
                this.searchParams = this.searchParam(this.queryParamsConfig, this.queryParams);
                this.queryParams.pageNum = 1;
                console.log(this.searchParams)
              //  this.getList();
            },
            resetQuery() {

            }
        }
    }
</script>

<style scoped>

</style>